package com.huawei.appmarket.service.infoflow.card;

import android.content.Context;
import android.os.Build.VERSION;
import android.view.View;
import androidx.databinding.ViewDataBinding;
import com.huawei.appgallery.foundation.card.base.normal.bean.NormalCardBean;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appmarket.service.infoflow.bean.InfoFlowTripleAppCardBean;
import com.huawei.appmarket.service.infoflow.cards.card.BaseInfoFlowCard;
import com.huawei.appmarket.service.store.awk.card.NormalCard;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import o.chy;
import o.ean;
import o.eww;

public class InfoFlowTripleAppCard extends BaseInfoFlowCard<eww> {
    private ArrayList<InfoFlowNormalCard> ʻ = new ArrayList();
    private ArrayList<View> ᐝ;

    public /* synthetic */ void ˊ(ViewDataBinding viewDataBinding) {
        ˏ((eww) viewDataBinding);
    }

    public InfoFlowTripleAppCard(Context context) {
        super(context);
        for (int i = 0; i < 3; i++) {
            this.ʻ.add(new InfoFlowNormalCard(context));
        }
    }

    public void ˏ(eww o_eww) {
        super.ˊ(o_eww);
        this.ᐝ = new ArrayList(Arrays.asList(new View[]{o_eww.ˋ, o_eww.ˏ, o_eww.ॱ}));
        for (int i = 0; i < 3; i++) {
            InfoFlowNormalCard infoFlowNormalCard = (InfoFlowNormalCard) this.ʻ.get(i);
            infoFlowNormalCard.ˏ(this.ˋ);
            infoFlowNormalCard.ˏ((View) this.ᐝ.get(i));
        }
    }

    public void ˏ(CardBean cardBean) {
        super.ˏ(cardBean);
        if (cardBean instanceof InfoFlowTripleAppCardBean) {
            InfoFlowTripleAppCardBean infoFlowTripleAppCardBean = (InfoFlowTripleAppCardBean) cardBean;
            List ˊ = infoFlowTripleAppCardBean.ˊ();
            int i = 0;
            while (i < 3) {
                CardBean cardBean2;
                if (ˊ == null || ˊ.size() <= i) {
                    cardBean2 = null;
                } else {
                    cardBean2 = (NormalCardBean) ˊ.get(i);
                }
                NormalCard normalCard = (NormalCard) this.ʻ.get(i);
                if (cardBean2 != null) {
                    cardBean2.ˏ(null);
                    cardBean2.ˋˋ(infoFlowTripleAppCardBean.ॱˉ());
                    cardBean2.ʽॱ(ean.ˎ(infoFlowTripleAppCardBean));
                    normalCard.ˏ(cardBean2);
                    ((View) this.ᐝ.get(i)).setVisibility(0);
                } else {
                    if (VERSION.SDK_INT <= 23) {
                        normalCard.ˏ(new NormalCardBean());
                    }
                    ((View) this.ᐝ.get(i)).setVisibility(8);
                }
                i++;
            }
        }
    }

    public void ॱ(chy o_chy) {
        for (int i = 0; i < 3; i++) {
            ((NormalCard) this.ʻ.get(i)).ॱ(o_chy);
        }
    }

    public ArrayList<String> ˋ() {
        ArrayList<String> arrayList = new ArrayList();
        if (this.ˊᐝ instanceof InfoFlowTripleAppCardBean) {
            List ˊ = ((InfoFlowTripleAppCardBean) this.ˊᐝ).ˊ();
            if (ˊ != null) {
                for (int i = 0; i < Math.min(3, ˊ.size()); i++) {
                    NormalCardBean normalCardBean = (NormalCardBean) ˊ.get(i);
                    arrayList.add(normalCardBean.ॱॱ() + "#$#" + normalCardBean.u_());
                }
            }
        }
        return arrayList;
    }
}
